package homeWork.day03;

import java.util.*;

/**
 * 生成10个0-100之间的不重复的随机数,并输出
 * @author Xiloer
 *
 */
public class Test03 {
	public static void main(String[] args) {
		Random rand = new Random();
		int r;
		Collection<Integer> randNums = new HashSet<>();
		while (randNums.size()<10){
			r = rand.nextInt(101);
			randNums.add(r);
		}
		Iterator it = randNums.iterator();
		while(it.hasNext()){
			System.out.println(it.next());
		}
	}
}
